<?php
header('Content-Type: text/html; charset=utf-8');
error_reporting(0);
session_start();
include_once '../comm/config.php';
include_once '../comm/checkpostandget.php';
include_once 'check.php';
include_once 'page.class.php';
include_once '../comm/wjt.php';
$s=include('../data/status.php');
$status=$s['dh_status'];
$keyword=$_GET['keyword']; 
$page = !($_GET['page'])?'1':intval($_GET['page']);
$pagesize=5;
$page2=($page-1)*$pagesize;

$sql="select a.name,a.fangshi,a.spend,a.spid,b.pic from ".$BIAOTOU."dhdingdan as a,".$BIAOTOU."dhlist as b where a.spid=b.id and a.dduserid='".$_SESSION["dduserid"]."'";
$rs = mysql_query($sql);
$total = mysql_num_rows($rs);	
$sql="select a.name,a.fangshi,a.spend,a.spid,a.tbusername,a.address,a.qq,a.remarks,a.status,b.pic from ".$BIAOTOU."dhdingdan as a,".$BIAOTOU."dhlist as b where a.spid=b.id and a.dduserid='".$_SESSION["dduserid"]."' order by a.id desc limit $page2,$pagesize";
$rs = mysql_query($sql);

$tag="center";
$cur='huan';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>商品兑换中心 - 用户中心</title>
<script type="text/javascript" src="../js/jquery.js"></script>
<link href="../css/usercss.css" rel="stylesheet" type="text/css">
<link href="../template/<?=MOBAN?>/css/common.css" rel="stylesheet" type="text/css">
<style type="text/css">
#newPreview{filter: progid: DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);}
#apDiv022{width: 715px;height: 88px;border-bottom-width: 1px;border-bottom-style: dashed;border-bottom-color: #CCCCCC;margin-top: 10px;float: left;}
#apDiv25{width: 70px;height: 70px;padding: 5px;float: left;border: 1px dotted #CCCCCC;margin-bottom: 5px;}
#apDiv066{width: 620px;height: 85px;float: right;}
#apDiv199{height: 40px;line-height: 40px;overflow: hidden;margin-right: 5px;}
</style>
</head><body id="jfduihuan">
<?php include("../template/".MOBAN."/header.tpl.php");?>
<?php include("../template/".MOBAN."/nav.tpl.php");?>
<div id="main" style="height:auto">
<?php include("left.php");?>
<div class="contain">
<h2 class="left_nav2">商品兑换中心&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i style="font-style:normal; font-weight:normal"><a href="../huan.php">[现在就去换购]</a></i></h2>
<div class="order">
<div class="content" style="font-size:12px;">
<?php
while ($row = mysql_fetch_array($rs)){
?>
<div id="apDiv022">
<div id="apDiv25"><a href="../huangou.php?id=<?=$row["spid"]?>" target="_blank"><img src="<?=$row["pic"]?>" width="70" height="70" /></a></div>
<div id="apDiv066">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="color:#999999;">
  <tr>
    <td width="35%" height="40">&nbsp;<?=$row["name"]?></td>
    <td width="21%">&nbsp;Q&nbsp;&nbsp;Q：<?=$row["qq"]?></td>
    <td width="22%">&nbsp;姓名：
      <?=$row["tbusername"]?></td>
    <td width="22%">状态：<?=$status[$row["status"]]?></td></tr>
  <tr>
    <td height="40"><div id="apDiv199">收货地址：<?=$row["address"]?></div></td>
    <td colspan="2"><div id="apDiv199">补充：<?=$row["remarks"]?></div></td>
    <td style="font-size:14px;"><img src="../template/<?=MOBAN?>/images/dh<?=$row['fangshi']?>.gif" /> <?=$row['spend']?></td>
    </tr>
</table>
</div></div><?php }?></div>
</div></div>
<div class="megas512" style="clear:both"><?php pageft($total,$pagesize,1,1,0,10,"?keyword=".urlencode($keyword));echo $pagenav;?></div>
</div>

<?php include("../template/".MOBAN."/footer.tpl.php");?>
</body>
</html>